package org.algorithm;

import com.alibaba.fastjson.JSONArray;

import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;

public class RandomNumber {
    public static void main(String[] args){
        doubleT();
    }

    public static void doubleT(){
        for (int i = 0 ; i<6;i++){
            System.out.print((ThreadLocalRandom.current().nextInt(33)+1)+" ");
        }
        System.out.println();
        for (int i = 0 ; i<5;i++){
            System.out.print((ThreadLocalRandom.current().nextInt(16)+1)+" ");
        }
        System.out.println();
    }

    public static void phy(){
        Set<String> red = new HashSet<>();
        Set<String> blue = new HashSet<>();
        while(red.size()<5){
            String now= (ThreadLocalRandom.current().nextInt(35)+1)+" ";
            if(red.contains(now)){
                red.remove(now);
            }else {
                red.add(now);
            }
        }
        while(blue.size()<4){
            String now= (ThreadLocalRandom.current().nextInt(12)+1)+" ";
            if(blue.contains(now)){
                blue.remove(now);
            }else {
                blue.add(now);
            }
        }
        System.out.println(JSONArray.toJSONString(red));
        System.out.println(JSONArray.toJSONString(blue));
    }
}
